import { App } from 'vue';
import { withInstall } from '@ibiz-template/vue3-util';
import { registerPanelItemProvider } from '@ibiz-template/runtime';
import { PanelBottomTabPanel } from './panel-bottom-tab-panel';
import { PanelBottomTabPanelProvider } from './panel-bottom-tab-panel.provider';

const IBizPanelBottomTabPanel = withInstall(
  PanelBottomTabPanel,
  function (v: App) {
    v.component(PanelBottomTabPanel.name!, PanelBottomTabPanel);
    registerPanelItemProvider(
      'CUSTOM_PANEL_BOTTOM_TABPANEL',
      () => new PanelBottomTabPanelProvider(),
    );
  },
);

export default {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
  install(app: App) {
    app.use(IBizPanelBottomTabPanel);
  },
};
